package com.demo.weather.receiver;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 实时监测通道
 * 
 * @author tangheng
 */
@AllArgsConstructor
@Data
public class RealTimeMonitorN {
	
	/**通道序号*/
	private int order;
	/**名称*/
	private String name;
	/**是否无符号整数*/
	private boolean unsiged;
	/**精度*/
	private double precision;
	/**数据值*/
	private int value;
	/**单位*/
	private String unit;
	
	public RealTimeMonitorN(int order, String name, boolean unsiged, double precision, String unit) {
		this.order = order;
		this.name = name;
		this.unsiged = unsiged;
		this.precision = precision;
		this.unit = unit;
	}
	
	@Override
	public String toString() {
		return String.format("%d-%s -> %.2f%s", order, name, precision*value, unit);
	}
}